package cn.zwx.member.svc.facade;

import cn.zwx.base.entity.ResponseEntity;
import cn.zwx.base.exception.BizWrapException;
import cn.zwx.member.svc.dto.DsitrictsListDTO;
import cn.zwx.member.svc.fallback.DsitrictsApiFallback;
import cn.zwx.member.svc.vo.DsitrictsListVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/**
 * @author zhangwenxue
 */
@FeignClient(name = "member-svc",path = "/dsitricts")
public interface DsitrictsServiceApi extends FallbackFactory<DsitrictsApiFallback> {

    @PostMapping
    DsitrictsApiFallback create(Throwable cause);

    /**
     * 查询地区信息
     * @param dto 请参数
     * @return 返回查询地区信息
     * @throws BizWrapException 业务一次
     */
    @PostMapping("/getDistrictsList")
    @ApiOperation("查询地区信息")
    ResponseEntity<List<DsitrictsListVO>> getDistrictsList(@Valid@RequestBody DsitrictsListDTO dto) throws BizWrapException;

}
